package com.cfets.annualAssessment.service;

import com.cfets.annualAssessment.entity.CfetsPics;
import com.cfets.annualAssessment.mapper.CfetsPicsMapper;
import com.cfets.annualAssessment.util.CheckUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author DavidSun
 * @create 2018-12-21 15:41
 * @desc cfetspics 的服务
 **/
@Service
public class CfetsPicsServie {
    @Autowired
    private CfetsPicsMapper cfetsPicsMapper;
    // 获取所有图片
    public List<CfetsPics> getList(CfetsPics cfetsPics){
        Example example = new Example(CfetsPics.class);
        Example.Criteria criteria = example.createCriteria();
        if (!CheckUtil.isEmpty(cfetsPics.getPic())){
            criteria.andLike("pic","%"+ cfetsPics.getPic()+"%");
        }

        return  cfetsPicsMapper.selectByExample(example);

    }
}
